package cn.com.epicc.wap.epe.product.controller;

import cn.com.epicc.wap.epe.common.result.Result;
import cn.com.epicc.wap.epe.product.vo.ProductPageVo;
import cn.com.epicc.wap.epe.product.vo.ProductVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Description: 产品子页面控制层
 * Author: lishangmin
 * Created: 2018-06-07 09:54
 */
@Api("产品子页面API")
@RestController
@RequestMapping("/page")
public class PageController {

    @ApiOperation("查询产品子页面")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "productKey", value = "产品主键" , required = true, paramType = "query"),
    })
    @RequestMapping(value = "/list",method = RequestMethod.GET)
    public Result<ProductVo> list(
            @RequestParam(value = "productKey")String productKey
    ){
        return Result.success(new ProductVo());
    }

    @ApiOperation("产品子页面创建")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "productKey", value = "产品主键" , required = true, paramType = "form"),
            @ApiImplicitParam(name = "pageCode", value = "页面代码" , required = true, paramType = "form"),
            @ApiImplicitParam(name = "pageName", value = "页面名称" , required = true, paramType = "form"),
            @ApiImplicitParam(name = "url", value = "URL" , required = true, paramType = "form"),
    })
    @RequestMapping(value = "/add",method = RequestMethod.POST)
    public Result<ProductPageVo> add(
            @RequestParam(value = "productKey")String productKey,
            @RequestParam(value = "pageCode")String pageCode,
            @RequestParam(value = "pageName")String pageName,
            @RequestParam(value = "url")String url
    ){
        return Result.success(new ProductPageVo());
    }

    @ApiOperation("产品子页面删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "sid", value = "主键" , required = true, paramType = "form")
    })
    @RequestMapping(value = "/delete",method = RequestMethod.POST)
    public Result delete(
            @RequestParam(value = "sid")String sid
    ){
        return Result.success();
    }
}
